<template>
  <a-card :bordered="false" class="card-area">
    <!-- 查询区域 11111-->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" :label-col="labelCol" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="订单号">
              <a-input placeholder="请输入订单号" v-model="queryParam.orderNo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="订单状态">
              <a-select v-model="queryParam.orderStatus" placeholder="请选择订单状态">
                <a-select-option value="">全部订单</a-select-option>
                <a-select-option value="0">未付款</a-select-option>
                <a-select-option value="1">进行中</a-select-option>
                <a-select-option value="2">已取消</a-select-option>
                <a-select-option value="3">已完成</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="订单类型">
              <a-select v-model="queryParam.orderType" placeholder="请选择订单状态">
                <a-select-option value="">全部</a-select-option>
                <a-select-option value="1">店内</a-select-option>
                <a-select-option value="2">店外</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="支付方式">
              <a-select v-model="queryParam.payType" placeholder="请选择支付方式">
                <a-select-option value="">全部</a-select-option>
                <a-select-option value="1">现金</a-select-option>
                <a-select-option value="2">微信</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-item label="查询日期">
              <j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.startDate"></j-date>
              <span class="query-group-split-cust"></span>
              <j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.endDate"></j-date>
            </a-form-item>
          </a-col>


          <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
           <a-col :md="6" :sm="24">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
           </a-col>
        </span>
        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class="table-operator">

    </div>

    <!-- table区域-begin -->
    <div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
      </a-table>
    </div>
    <!-- table区域-end -->

  </a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { putAction, getAction, postAction } from '@/api/manage'
import { frozenBatch } from '@/api/api'
import JDate from '@/components/jeecg/JDate'
export default {
  name: 'ord_store_orderList',
  mixins: [JeecgListMixin],
  components: {
    JDate
  },
  data() {
    return {
      description: '餐饮平台订单记录表管理页面',
      labelCol: { style: { width: '110px' } },
      queryParam: {
        orderStatus: '',
        orderNo:"",
      },
      // 表头
      columns: [
        {
          title: '订单号',
          align: 'center',
          dataIndex: 'orderNo',
          width:250,
        },
        {
          title: '订单类型',
          align: 'center',
          dataIndex: 'orderType',
          customRender: function(t, r, index) {
            if (t == 3) {
              return '店外'
            }
            return '店内'
          },
          width:130,
        },
        {
          title: '应付金额',
          align: 'center',
          dataIndex: 'cpOriginalPrice',
          width:130,
        },
        {
          title: '实付金额',
          align: 'center',
          dataIndex: 'cpConsumeAmount',
          width:130,
        },
        {
          title: '退款金额',
          align: 'center',
          dataIndex: 'refundMoney',
          width:130,
        },
        {
          title: '订单状态',
          align: 'center',
          dataIndex: 'orderStatus',
          width:130,
          customRender: function(t, r, index) {
            //订单状态 0待支付 1进行中  2已完成 4已退单
            if (t == '0') {
              return '未付款'
            } else if (t == '1') {
              return '进行中'
            } else if (t == '2') {
              return '已完成'
            }
            return '已退单'
          },
        },
        {
          title: '创建时间',
          align: 'center',
          dataIndex: 'orderTime',
          width:130,
        }
      ],
      url: {
        list: '/store/order/list/finance',
        delete: '/system/ordStoreOrder/delete',
      }
    }
  },
  computed: {
    importExcelUrl: function() {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  methods: {}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
